package ds.safelock.config;

public class Configuration {
	
	/** Static **/
	public static final String DIGEST_ALGORITHM_V2 = "SHA-512";
	public static final String DIGEST_ALGORITHM = "SHA-256";
	public static final String CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";
	public static final String MAC_ALGORITHM = "HmacSHA512";
	public static final String KEY_ALGORITHM = "AES";
	public static final String KEYFACTORY_ALGORITHM = "PBKDF2WithHmacSHA1";
	public static final String SALT_ALGORITHM = "SHA1PRNG";
	public static final int SALT_SIZE = 1024;
	public static final String CHARSET = "UTF-8";

	public static final String USER_DIR = "users/";
	public static final String FILE_SALT = "sls";
	public static final String FILE_AUTH = ".slauth";
	
	public static final String DATABASE_NAME = "sldb";

	public static final String[][] REPLACEMENT = {{"a","[àáâãä]"},
												  {"e","[èéêë]"},
												  {"i","[ìíîï]"},
												  {"o","[òóôõö]"},
												  {"u","[ùúûüũ]"},
												  {"c","[ç]"},
												  {"n","[ñ]"}};
	
	/** UI Related **/
	public static final javax.swing.Icon ICON = new javax.swing.ImageIcon(Configuration.class.getClass().getResource("/ds/safelock/ui/images/safelock.png"));
	public static final int UI_LOGIN_MAX_WIDTH = 408, UI_LOGIN_MIN_WIDTH = 260;
	public static final int DEFAULT_TOOLTIP_TIMEOUT = javax.swing.ToolTipManager.sharedInstance().getDismissDelay(),
							LONG_TOOLTIP_TIMEOUT = 30000;
	
	/** non-static **/
	public static String HOME;
	public static ds.safelock.util.OS OPERATING_SYSTEM;
	
	public static void updateConfig(String username)
	{
		HOME = USER_DIR+username.toLowerCase()+"/";
		OPERATING_SYSTEM = ds.safelock.util.OS.getRunningOS();
	}
	
}
